<%@ page import="net.zjitc.domain.User" %><%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2017/10/12
  Time: 10:14
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
  <%

      HttpSession session1 = request.getSession();
      User user = (User) session1.getAttribute("user");
     /*处理空指针异常的问题*/
      String username = "";
      if (user != null){
          username = user.getUsername();
      }else {
          request.setAttribute("msg","请先登录");
          request.getRequestDispatcher("/login/login.jsp").forward(request,response);
          return;
      }

  %>
  <h5>欢迎 <font color="red"><%=username %></font> 来访问。。。。。。 <a href="/jspTest/logoutServlet">退出</a></h5>
</body>

</html>
